<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第四题</title>
</head>

<body>
    <script>
        function getMaxmin() {
            const arr = [45, 56, 78, 86, 98, 12, 4, 3, 5, 88, 23, 24, 77]
            arr.sort(function (a, b) {
                return a - b
            })
            return [arr[0], arr[arr.length - 1]]
        }
        let arr1 = getMaxmin()
        console.log(`最小值为：${arr1[0]}  最大值为：${arr1[1]}`)
    </script>
</body>

</html>